<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\model;

use app\common\bean\UserBean;
use app\common\bean\UserImageBean;

class UserImageModel extends BaseModel
{
	protected $table = 'user_image';
    protected $append = ['domain_url'];
	/**
	* @return UserImageModel
	*/
	static function getInstance(){
		return parent::getInstance();
	}

    public function getDomainUrlAttr($value, $data){
        $imgList  = $this->getImgList($data[UserImageBean::$pic]);
        return !$imgList?'':$this->domainImgList($imgList);
    }
    /** 所属用户
     * @return \think\model\relation\BelongsTo
     */
    public function user(){
        return $this->belongsTo('UserModel',UserImageBean::$userId,UserBean::$id);
    }
}
